CREATE TABLE [dbo].[tb_Tracking]
(
[idTracking] [int] NOT NULL IDENTITY(1, 1),
[Tramite] [int] NOT NULL,
[NroSubTramite] [int] NOT NULL,
[Tarea] [int] NOT NULL,
[Desde] [datetime] NOT NULL,
[FechaRecepcion] [datetime] NULL,
[FechaActivacion] [datetime] NULL,
[Hasta] [datetime] NULL,
[Responsable] [int] NULL,
[Estado] [int] NOT NULL,
[ReparticionDestino] [int] NOT NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_Tracking] ADD CONSTRAINT [PK_tb_Tracking] PRIMARY KEY NONCLUSTERED  ([idTracking]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_Tracking] WITH NOCHECK ADD CONSTRAINT [FK_tb_Tracking_tb_EstadosDeTracking] FOREIGN KEY ([Estado]) REFERENCES [dbo].[tb_EstadosDeTracking] ([idEstadoTracking])
GO
ALTER TABLE [dbo].[tb_Tracking] WITH NOCHECK ADD CONSTRAINT [FK_tb_Tracking_tb_Usuarios] FOREIGN KEY ([Responsable]) REFERENCES [dbo].[tb_Usuarios] ([idUsuario])
GO
ALTER TABLE [dbo].[tb_Tracking] WITH NOCHECK ADD CONSTRAINT [FK_tb_Tracking_tb_Tareas] FOREIGN KEY ([Tarea]) REFERENCES [dbo].[tb_Tareas] ([idTarea])
GO
ALTER TABLE [dbo].[tb_Tracking] WITH NOCHECK ADD CONSTRAINT [FK_tb_Tracking_tb_TramitesDocumentos] FOREIGN KEY ([Tramite]) REFERENCES [dbo].[tb_TramitesDocumentos] ([idTramite])
GO
